Skip to content

chore(python): allow ignoring xpub magic in trezorctl#6935

Merged
romanz merged 1 commit into
mainfrom
romanz/2605/cli-ignore-xpub
May 15, 2026
Merged

chore(python): allow ignoring xpub magic in trezorctl#6935
romanz merged 1 commit into
mainfrom
romanz/2605/cli-ignore-xpub

Conversation

@romanz
Copy link
Copy Markdown
Contributor

@romanz romanz commented May 15, 2026

Output descriptors don't use ypub/zpubs.

Can be tested using:

$ trezorctl btc get-public-node -n 'm/84h/0h/0h'
node.depth: 3
node.fingerprint: d4c3eca0
node.child_num: 2147483648
node.chain_code: 0a4cedfefa23737d00b4a724e1d8b47a0602472cbe6fb8b7efa72dcb021584f8
node.public_key: 03e36a4f3fee21bfe83447b209d8de6da1ce1ae38f76bc2c00652dc5e0a8c5c0b5
xpub: zpub6rszzdAK6RuafeRwyN8z1cgWcXCuKbLmjjfnrW4fWKtcoXQ8787214pNJjnBG5UATyghuNzjn6Lfp5k5xymrLFJnCy46bMYJPyZsbpFGagT

$ trezorctl btc get-public-node -n 'm/84h/0h/0h' --ignore-xpub-magic
node.depth: 3
node.fingerprint: d4c3eca0
node.child_num: 2147483648
node.chain_code: 0a4cedfefa23737d00b4a724e1d8b47a0602472cbe6fb8b7efa72dcb021584f8
node.public_key: 03e36a4f3fee21bfe83447b209d8de6da1ce1ae38f76bc2c00652dc5e0a8c5c0b5
xpub: xpub6DDUPHpUo4pcy43iJeZjbSVWGav1SMMmuWdMHiGtkK8rhKmfbomtkwW6GKs1GGAKehT6QRocrmda3WWxXawpjmwaUHfFRXuKrXSapdckEYF

Output descriptors don't use ypub/zpubs.

[no changelog]
@romanz romanz requested review from M1nd3r and obrusvit May 15, 2026 13:55
@romanz romanz self-assigned this May 15, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Review Change Stack

Walkthrough

This PR adds a new -i/--ignore-xpub-magic boolean flag to the get_public_node CLI command. The flag is declared via Click's option decorator, added to the command function signature, and forwarded to the underlying btc.get_public_node service call as the ignore_xpub_magic argument.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description lacks critical information required by the template for core developers, including issue assignment, project setup, and development status indicators. Add required sections: Assign yourself, add to Firmware project with Priority/Team/Sprint, and set development status (In Progress for draft, Needs Review for final).
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: adding a flag to allow ignoring xpub magic in the trezorctl CLI tool, which matches the changeset's addition of the -i/--ignore-xpub-magic flag to the get_public_node command.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch romanz/2605/cli-ignore-xpub

Warning

Review ran into problems

🔥 Problems

Stopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a @coderabbit review after the pipeline has finished.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@trezor-bot trezor-bot Bot added this to Firmware May 15, 2026
@github-project-automation github-project-automation Bot moved this to 🔎 Needs review in Firmware May 15, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

en main(all)

model device_test click_test persistence_test
T2T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3B1 test(all) main(all) test(all) main(all) test(all) main(all)
T3T1 test(all) main(all) test(all) main(all) test(all) main(all)
T3W1 test(all) main(all) test(all) main(all) test(all) main(all)

Latest CI run: 25924410904

Copy link
Copy Markdown
Contributor

@M1nd3r M1nd3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@romanz romanz marked this pull request as ready for review May 15, 2026 14:51
@romanz romanz requested a review from matejcik as a code owner May 15, 2026 14:51
@romanz romanz added the trezorlib Python library and the command line trezorctl tool. label May 15, 2026
@M1nd3r
Copy link
Copy Markdown
Contributor

M1nd3r commented May 15, 2026

Tested with the same result:

Screenshot from 2026-05-15 17-14-56

@romanz romanz merged commit 5976e75 into main May 15, 2026
192 checks passed
@romanz romanz deleted the romanz/2605/cli-ignore-xpub branch May 15, 2026 15:24
@trezor-bot trezor-bot Bot moved this from 🔎 Needs review to 🤝 Needs QA in Firmware May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trezorlib Python library and the command line trezorctl tool.

Projects

Status: 🤝 Needs QA

Development

Successfully merging this pull request may close these issues.

2 participants